home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windows Game Programming for Dummies (2nd Edition)
/
WinGamProgFD.iso
/
mac
/
DirectX SDK
/
DXSDK
/
samples
/
Multimedia
/
VBSamples
/
DirectSound
/
EffectsBuffers
/
frmChorus.frm
next >
Wrap
Text File
|
2001-10-08
|
9KB
|
319 lines
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmChorus
BorderStyle = 4 'Fixed ToolWindow
Caption = "Chorus Effects Update"
ClientHeight = 4440
ClientLeft = 45
ClientTop = 285
ClientWidth = 2775
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4440
ScaleWidth = 2775
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin VB.CommandButton cmdOK
Caption = "OK"
Height = 315
Left = 1800
TabIndex = 15
Top = 4020
Width = 915
End
Begin VB.OptionButton optSin
Caption = "Sine"
Height = 255
Left = 120
TabIndex = 11
Top = 3600
Width = 915
End
Begin VB.OptionButton optTriangle
Caption = "Triangle"
Height = 255
Left = 1680
TabIndex = 10
Top = 3600
Width = 915
End
Begin MSComctlLib.Slider sldFeedback
Height = 195
Left = 60
TabIndex = 0
Top = 360
Width = 2655
_ExtentX = 4683
_ExtentY = 344
_Version = 393216
LargeChange = 10
Min = -99
Max = 99
SelStart = 1
TickFrequency = 10
Value = 1
End
Begin MSComctlLib.Slider sldDelay
Height = 195
Left = 60
TabIndex = 1
Top = 900
Width = 2655
_ExtentX = 4683
_ExtentY = 344
_Version = 393216
Max = 20
TickFrequency = 2
End
Begin MSComctlLib.Slider sldDepth
Height = 195
Left = 60
TabIndex = 2
Top = 1440
Width = 2655
_ExtentX = 4683
_ExtentY = 344
_Version = 393216
Max = 100
TickFrequency = 10
End
Begin MSComctlLib.Slider sldFreq
Height = 195
Left = 60
TabIndex = 3
Top = 1980
Width = 2655
_ExtentX = 4683
_ExtentY = 344
_Version = 393216
TickFrequency = 2
End
Begin MSComctlLib.Slider sldPhase
Height = 195
Left = 60
TabIndex = 8
Top = 2520
Width = 2655
_ExtentX = 4683
_ExtentY = 344
_Version = 393216
LargeChange = 2
Max = 4
End
Begin MSComctlLib.Slider sldWetDry
Height = 195
Left = 60
TabIndex = 13
Top = 3060
Width = 2655
_ExtentX = 4683
_ExtentY = 344
_Version = 393216
LargeChange = 10
SmallChange = 5
Max = 100
SelStart = 1
TickFrequency = 10
Value = 1
End
Begin VB.Label lbl
BackStyle = 0 'Transparent
Caption = "Wet Dry Mix"
Height = 255
Index = 6
Left = 60
TabIndex = 14
Top = 2820
Width = 1035
End
Begin VB.Label lbl
BackStyle = 0 'Transparent
Caption = "Wave Form"
Height = 255
Index = 5
Left = 60
TabIndex = 12
Top = 3360
Width = 915
End
Begin VB.Label lbl
BackStyle = 0 'Transparent
Caption = "Phase"
Height = 255
Index = 2
Left = 60
TabIndex = 9
Top = 2280
Width = 1035
End
Begin VB.Label lbl
BackStyle = 0 'Transparent
Caption = "Feedback"
Height = 255
Index = 1
Left = 60
TabIndex = 7
Top = 120
Width = 735
End
Begin VB.Label lbl
BackStyle = 0 'Transparent
Caption = "Delay"
Height = 255
Index = 0
Left = 60
TabIndex = 6
Top = 660
Width = 735
End
Begin VB.Label lbl
BackStyle = 0 'Transparent
Caption = "Depth"
Height = 255
Index = 3
Left = 60
TabIndex = 5
Top = 1200
Width = 1035
End
Begin VB.Label lbl
BackStyle = 0 'Transparent
Caption = "Frequency"
Height = 255
Index = 4
Left = 60
TabIndex = 4
Top = 1740
Width = 1035
End
End
Attribute VB_Name = "frmChorus"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'
' Copyright (C) 1999-2001 Microsoft Corporation. All Rights Reserved.
'
' File: frmChorus.frm
'
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private oBuffer As DirectSoundSecondaryBuffer8
Private mlIndex As Long
Private oFX As DirectSoundFXChorus8
Private Sub SaveAllSettings()
Dim fxNew As DSFXCHORUS
'Ok, save these new settings
'Set the new information up
With fxNew
.fFeedback = CSng(sldFeedback.Value)
.fDelay = CSng(sldDelay.Value)
.fDepth = CSng(sldDepth.Value)
.fWetDryMix = CSng(sldWetDry.Value)
.fFrequency = CSng(sldFreq.Value)
.lPhase = sldPhase.Value
If optSin.Value Then
.lWaveform = DSFX_WAVE_SIN
ElseIf optTriangle.Value Then
.lWaveform = DSFX_WAVE_TRIANGLE
End If
End With
'Now update the effect
oFX.SetAllParameters fxNew
End Sub
Private Sub cmdOK_Click()
SaveAllSettings
Unload Me
End Sub
Private Sub Form_Load()
Dim fxCurrent As DSFXCHORUS
'Get the echo interface
Set oFX = oBuffer.GetObjectinPath(DSFX_STANDARD_CHORUS, mlIndex, IID_DirectSoundFXChorus)
'Get the current settings from it
fxCurrent = oFX.GetAllParameters
'Now put them out there
With fxCurrent
sldFeedback.Value = CLng(.fFeedback)
sldDelay.Value = CLng(.fDelay)
sldDepth.Value = CLng(.fDepth)
sldWetDry.Value = CLng(.fWetDryMix)
sldFreq.Value = CLng(.fFrequency)
sldPhase.Value = .lPhase
If .lWaveform = DSFX_WAVE_SIN Then
optSin.Value = True
ElseIf .lWaveform = DSFX_WAVE_TRIANGLE Then
optTriangle.Value = True
End If
End With
End Sub
Public Sub SetBuffer(oBuf As DirectSoundSecondaryBuffer8, Index As Long)
'Store the buffer and index
Set oBuffer = oBuf
mlIndex = Index
End Sub
Private Sub optSin_Click()
SaveAllSettings
End Sub
Private Sub optTriangle_Click()
SaveAllSettings
End Sub
Private Sub sldDelay_Change()
SaveAllSettings
End Sub
Private Sub sldDelay_Scroll()
SaveAllSettings
End Sub
Private Sub sldDepth_Change()
SaveAllSettings
End Sub
Private Sub sldDepth_Scroll()
SaveAllSettings
End Sub
Private Sub sldFeedback_Change()
SaveAllSettings
End Sub
Private Sub sldFeedback_Scroll()
SaveAllSettings
End Sub
Private Sub sldFreq_Change()
SaveAllSettings
End Sub
Private Sub sldFreq_Scroll()
SaveAllSettings
End Sub
Private Sub sldPhase_Change()
SaveAllSettings
End Sub
Private Sub sldPhase_Scroll()
SaveAllSettings
End Sub
Private Sub sldWetDry_Change()
SaveAllSettings
End Sub
Private Sub sldWetDry_Scroll()
SaveAllSettings
End Sub